package name.fuhan.biaoqing_fh_demo;

import name.fuhan.biaoqing_fh.BiaoQing_Show;
import name.fuhan.biaoqing_fh.BiaoQing_in;
import name.fuhan.biaoqing_fh.BiaoQing_in.OnSendClickListener;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends Activity {

	private TextView text1;
	private BiaoQing_Show text2;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		BiaoQing_in.Config
						  .setPath("BiaoQing_default")//指定表情图片目录
				   		  .setMaxTextCount(140)//设置最大字数,默认为140
				   		  .setRowCountAndColumnCount(3, 10)//设置表情选择器的行数和列数,表情图片都是正方形,列数太少会使选择器变得好高
				   		  .setLines(5)//设置输入框为5行
				   		  .setMaxLines(20)//输入框最多输入20行
				   		  .setEnterIsSend(false);//设置可多行输入
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_activity);
		BiaoQing_in bq = $(R.id.bq_in);
		text1 = $(R.id.text1);
		text2 = $(R.id.text2);
		
		bq.setOnSendClickListener(new OnSendClickListener() {
			@Override
			public void onSend(Editable editable) {
				text1.setText(editable.toString());
				text2.setBiaoQingString(editable.toString());
			}
		});
	}
	public <T extends View> T $(int id){
		return (T)findViewById(id);
	}
}
